package com.cheng.lesson01;

import java.net.InetSocketAddress;

public class TestInetSocketAddress {
    public static void main(String[] args) {
        InetSocketAddress socketAddress = new InetSocketAddress("127.0.0.1", 8080);
        System.out.println(socketAddress);

        InetSocketAddress socketAddress1 = new InetSocketAddress("localhost", 8080);
        System.out.println(socketAddress1);

        System.out.println(socketAddress.getAddress());///127.0.0.1
        System.out.println(socketAddress.getHostName());///127.0.0.1
        System.out.println(socketAddress.getPort());//8080


    }
}
